$(document).ready(function() {
	$('#optionsPanel').hide();
	$("#btnUpdate").click(function(event) {
		event.preventDefault();
		updateCaseInfo();       
	});
	$('#btnReply').click(function(event) {
		$('#replyPanel-remarksDiv').hide();
		$('#replyPanel').toggle('drop');
	});
	$('#btnMoreOptions').click(function(event) {
		$('div#optionsPanel').toggle('drop');
		if($('#btnMoreOptions > i').hasClass('fa-chevron-up'))
		{
			$('#btnMoreOptions > i').removeClass('fa-chevron-up').addClass('fa-chevron-down');
		}else{
			$('#btnMoreOptions > i').removeClass('fa-chevron-down').addClass('fa-chevron-up');
		}
	});
	$('#replyPanel-btnAddRemarks').click(function(event) {
		if($('#replyPanel-btnAddRemarks > i').hasClass('fa-chevron-up'))
		{
			$('#replyPanel-btnAddRemarks > i').removeClass('fa-chevron-up').addClass('fa-chevron-down');
		}else{
			$('#replyPanel-btnAddRemarks > i').removeClass('fa-chevron-down').addClass('fa-chevron-up');
		}
	});
	$('#btnLinkCase').click(function(event) {
		var caseID = $('#caseID').text();
		$.jGrowl("Selected cases are linked with case " + caseID, {
			life: 10000
		});
	});
	$('#btnApproveReply').click(function(event) {
		$('#btnApproveReply').hide('fade',function () {
			$('#btnApproveReplyTd').append('<span style="color:#037e37;">Approved</span>');
			$.jGrowl("You just approved this reply! ",{life:3000});
		});
	});
	$('#btnApproveCheck').click(function(event) {
		$( "#dialog-form" ).dialog( "open" );
	});
});

function btnChange2Edit(styleClass){
    $('#btnAcceptDiv').hide('fade', function() {
        $('#btnEditDiv').show('fade');
    });
}

function redirectEdit(){
    var _caseID = $(document).getUrlParam("caseID");
    document.location.href = "update-case(1).html?caseID=" + _caseID;
}
